import request from '@/utils/request'

// 查询设备列表
export function listDevice(data) {
    return request({
        url: '/device/device/list',
        method: 'get',
        data: data
    })
}

// 查询设备下拉选择列表
export function selectMulDev(data) {
    return request({
        url: '/device/device/mulDev',
        method: 'post',
        data: data
    })
}



// 查询设备详细
export function getDevice(deviceId) {
    return request({
        url: '/device/device/get/' + deviceId,
        method: 'get',
    })
}

// 新增设备
export function addDevice(data) {
    return request({
        url: '/device/device',
        method: 'post',
        data: data
    })
}

// 修改设备
export function updateDevice(data) {
    return request({
        url: '/device/device',
        method: 'put',
        data: data
    })
}

// 删除设备
export function delDevice(deviceId) {
    return request({
        url: '/device/device/' + deviceId,
        method: 'delete'
    })
}

//机台状态统计数据
export function getStaNum(data) {
    return request({
        url: '/device/device/sta',
        method: 'post',
        data: data
    })
}

//机台状态统计数据
export function getStaByWeek() {
    return request({
        url: '/device/device/getStaByWeek',
        method: 'post',
    })
}


/**
 * @param {Object} 厂区列表
 */
export function areaList(data) {
    return request({
        url: '/device/device/areaList',
        method: 'get',
        data: data
    })
}

/**
 * @param {Object} 根据sn查询
 */
export function getBySn(data) {
    return request({
        url: '/device/device/bysn',
        method: 'post',
        data: data
    })
}

export function updateBySn(data) {
    return request({
        url: '/device/device/updateBySn',
        method: 'post',
        data: data
    })
}
//查询可关联设备
export function selectCanRelList(data) {
    return request({
        url: '/device/device/relList',
        method: 'post',
        data: data
    })
}

//查询已关联设备
export function selectBindList(data) {
    return request({
        url: '/device/device/bindList',
        method: 'post',
        data: data
    })
}

//设备人员绑定
export function bindById(data) {
    return request({
        url: '/device/device/bindById',
        method: 'post',
        data: data
    })
}
//设备人员解绑
export function untieBySn(data) {
    return request({
        url: '/device/device/untieBySn',
        method: 'post',
        data: data
    })
}

//根据机台号查询机台信息
export function getBindDevByNum(data) {
    return request({
        url: '/device/device/getBindByNum',
        method: 'post',
        data: data
    })
}

//根据sn查询员工绑卡信息
export function getEmpInfoBysn(data) {
    return request({
        url: '/device/device/getEmpBySn',
        method: 'post',
        data: data
    })
}

//发送绑卡信息指令
export function sendInfo(data) {
    return request({
        url: '/device/device/sendInfo',
        method: 'post',
        data: data
    })
}






